import java.util.Scanner;

public class Test {
    public static int func(int n){
        if(n<9){
            return n;
        }
        System.out.println(n%10);
        return func(n/10);
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            System.out.println(func(n));
        }
    }
}
